{ INFORMATICS.MCCME.RU
  Problem statement: http://informatics.mccme.ru/moodle/mod/statements/view3.php?chapterid=1620
  Verdict: Accepted
}
uses SysUtils, Math;
 
var
	i,n,rr,cc,kk,e,s:longint;
	a:array[0..100010] of int64;
	c,l,r,good,mx:int64;
 
procedure sort(l,r:longint);
var
	i,j,x,y:longint;
begin
i:=l;
j:=r;
x:=a[(l+r) div 2];
repeat
	while a[i]<x do inc(i);
	while a[j]>x do dec(j);
	if i<=j then begin
		y:=a[i];
		a[i]:=a[j];
		a[j]:=y;
		inc(i);
		dec(j);
	end;
until i>j;
if l<j then sort(l,j);
if i<r then sort(i,r);
end;
 
begin
reset(input,'input.txt');
rewrite(output,'output.txt');
read(n,rr,cc);
for i:=1 to n do
	read(a[i]);
sort(1,n);
l:=0;
r:=a[n]-a[1];
good:=r;
while r-l>0 do begin
	c:=(l+r) div 2;
	kk:=0;
	s:=1;
	e:=1;
	while (s<=n) and (e<=n) and (kk<rr) do begin
		while (e-s+1<cc) and (s<=n) and (e<=n) do
			if a[e+1]-a[s]<=c then inc(e) else inc(s);
		if (e-s+1=cc) and (e<=n) and (s<=n) then begin
			inc(kk);
			inc(e);
			s:=e;
		end else break;
	end;
	if kk>=rr then begin
		r:=c;
		good:=c;
	end else l:=c+1;
end;
c:=good;
mx:=0;
kk:=0;
s:=1;
e:=1;
while (s<=n) and (e<=n) and (kk<rr) do begin
	while (e-s+1<cc) and (s<=n) and (e<=n) do
		if a[e+1]-a[s]<=c then inc(e) else inc(s);
	if (e-s+1=cc) and (e<=n) and (s<=n) then begin
		inc(kk);
		mx:=max(mx,a[e]-a[s]);
	end;
	inc(e);
	s:=e;
end;
write(mx);
end.
 